<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>设备报修</title>
    <meta name="viewport" content="width=device-width"/>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
    <link rel="stylesheet" href="https://cdn.bootcss.com/weui/1.1.3/style/weui.min.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.1/css/jquery-weui.min.css">
    <script src="js/ajax.js"></script>
</head>
<body>
<div id="app" >
    <a href="javascript:;" onclick="qiangdan()" v-if="isQiang"
       style="width:90%;margin-top:20px;" class="weui-btn weui-btn_primary"
    >抢单</a>

    <span v-else style="text-align:center">
        您来迟了一步，好可惜，下次加油！
    </span>
</div>

<!-- body 最后 -->
<script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/jquery-weui.min.js"></script>

<!-- 如果使用了某些拓展插件还需要额外的JS -->
<script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/swiper.min.js"></script>
<script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/city-picker.min.js"></script>

<script>
    var v = new Vue({
        el: "#app",
        data: {
            isQiang:true
        }
    });

    // 获得修理人员的openid
    // 报修人的openid？
    var url = document.URL;
    var index = url.indexOf("id=")
    var  id = url.substring(index+3);



    $.get("/qiangdan",{id:id,openid:openid},function(data){
        if(data){
            v.isQiang = true;
            //创建修理页面
            //创建修理单
            location = 'repair.html?bxdid='+id
        }else{
            v.isQiang = false;
        }
    })

</script>

</body>
</html>